<template>
  <el-config-provider :locale="currentLocale">
    <router-view />
    <ReDialog />
    <alarm-pop-ups v-if="flag" />
  </el-config-provider>
</template>

<script lang="ts">
import { defineComponent, watch, ref } from "vue";
import { ElConfigProvider } from "element-plus";
import zhCn from "element-plus/lib/locale/lang/zh-cn";
import { ReDialog } from "@/components/ReDialog";
import { useAlarmWebsocketHook } from "@/store/modules/alarmWebSocket";
import alarmPopUps from "@/components/ReAlarm/index.vue";
export default defineComponent({
  name: "app",
  components: {
    [ElConfigProvider.name]: ElConfigProvider,
    ReDialog,
    alarmPopUps
  },
  setup() {
    const flag = ref<Boolean>(false);
    watch(
      () => useAlarmWebsocketHook().alarmPopUpsFlag,
      val => {
        flag.value = val;
      }
    );
    return { flag };
  },
  computed: {
    currentLocale() {
      return zhCn;
    }
  }
});
</script>
